using System.Collections.Generic;

public class Table_ComItemItem
{
    /// <summary>
    /// 唯一ID
    /// <summary>
    public int Id { get; private set; }
    /// <summary>
    /// 名称
    /// <summary>
    public string Name { get; private set; }
    /// <summary>
    /// 说明
    /// <summary>
    public string Desc { get; private set; }
    /// <summary>
    /// 图标名称
    /// <summary>
    public string Icon { get; private set; }
    /// <summary>
    /// 图标图集
    /// <summary>
    public string Atlas { get; private set; }
    /// <summary>
    /// 品质
    /// <summary>
    public int Quality { get; private set; }
    /// <summary>
    /// 堆叠上限
    /// <summary>
    public int StackSize { get; private set; }
    /// <summary>
    /// 总量上限
    /// <summary>
    public int MaxStack { get; private set; }
    /// <summary>
    /// 道具类型
    /// <summary>
    public int ClassType { get; private set; }
    /// <summary>
    /// 存放类型
    /// <summary>
    public int StorageType { get; private set; }
    /// <summary>
    /// 使用类型
    /// <summary>
    public int UseType { get; private set; }
    /// <summary>
    /// 使用参数
    /// <summary>
    public int UseParam { get; private set; }
    /// <summary>
    /// 产出途径
    /// <summary>
    public string OutPath { get; private set; }
    /// <summary>
    /// 产出类型
    /// <summary>
    public int OutType { get; private set; }
    /// <summary>
    /// 表格Id
    /// <summary>
    public int OutId { get; private set; }
    /// <summary>
    /// 是否可以出售
    /// <summary>
    public bool IsSell { get; private set; }
    /// <summary>
    /// 卖出货币类型
    /// <summary>
    public int ResType { get; private set; }
    /// <summary>
    /// 卖出价格
    /// <summary>
    public int Price { get; private set; }
    /// <summary>
    /// 排序优先级
    /// <summary>
    public int SortId { get; private set; }

    public Table_ComItemItem(ExcelLineReader reader)
    {
        Id = reader.ReadInt();
        Name = reader.ReadString();
        Desc = reader.ReadString();
        Icon = reader.ReadString();
        Atlas = reader.ReadString();
        Quality = reader.ReadInt();
        StackSize = reader.ReadInt();
        MaxStack = reader.ReadInt();
        ClassType = reader.ReadInt();
        StorageType = reader.ReadInt();
        UseType = reader.ReadInt();
        UseParam = reader.ReadInt();
        OutPath = reader.ReadString();
        OutType = reader.ReadInt();
        OutId = reader.ReadInt();
        IsSell = reader.ReadBool();
        ResType = reader.ReadInt();
        Price = reader.ReadInt();
        SortId = reader.ReadInt();
    }
}

public class Table_ComItemMgr : IDataMgr
{
    protected override string FileName { get { return "Txt/ComItem.txt"; } }

    protected List<Table_ComItemItem> mItemList = new List<Table_ComItemItem>();
    public Table_ComItemItem GetItemByIdx(int idx)
    {
        return mItemList[idx];
    }
    public Table_ComItemItem GetItemById(int id)
    {
        int idx = GetIdxById(id);
        return GetItemByIdx(idx);
    }

    public override void Load(ExcelLineReader reader)
    {
        var item = new Table_ComItemItem(reader);
        mItemDic.Add(item.Id, mDataCount);
        mItemList.Add(item);
    }
}